<?php namespace App\Controllers\Phm\Healthtrends;

use App\Controllers\Phm\TxController;

//访问地址：http://127.0.0.1/phm/public/index.php/phm/healthtrends/healthtrendsindex
class BreakTemperature extends TxController
{
    var $localUrl;
    private \App\Models\Phm\Healthtrends\ModelBreakTemperature $sqlQuery4BreakTemperature;

    function __construct()
    {
        parent::__construct();
        //此模块对应页面路径
        $this->localUrl = 'public/index.php/phm/healthtrends/breaktemperature/';
        //创建数据库连接
        $this->sqlQuery4BreakTemperature = new \App\Models\Phm\Healthtrends\ModelBreakTemperature();
    }

    public function urlImpExcel(){

        //头部
        echo view('phm/headsimple');

        echo '导入';

        //底部
        echo view('phm/footsimple');

    }

    //健康趋势
    public function index()
    {
        $QueryData = array();

        //取数据库的数据
        $Data = $this->sqlQuery4BreakTemperature->getBreak();
        //4个刹车温度
        $QueryData['break1'] = json_encode($Data[0]);
        $QueryData['break2'] = json_encode($Data[1]);
        $QueryData['break3'] = json_encode($Data[2]);
        $QueryData['break4'] = json_encode($Data[3]);
        //点了导入按钮Excel
        $QueryData["urlImpExcel"] = base_url($this->localUrl . 'urlImpExcel/');

        //显示数据
        echo view('phm/head', $this->menuUrl);
        echo view('phm/healthtrends/breaktemperature/breaktemperaturelist', $QueryData);
        echo view('phm/foot', $this->menuUrl);
    }

    //--------------------------------------------------------------------
}